#pragma once
#include "shapeobjects.h"
#define _PI					3.1415926535897932384626433832795

void VPtoDP(int x, int y, DOUBLE &X, DOUBLE &Y,const SHAPEPOS *pshp);
void DPtoVP(DOUBLE X, DOUBLE Y, long &x, long &y,const SHAPEPOS *pshp);
DOUBLE VLtoDL(int l,const SHAPEPOS *pshp);
int DLtoVL(DOUBLE l,const SHAPEPOS *pshp);
double GetAngle(DOUBLE bx,DOUBLE by,DOUBLE x,DOUBLE y);
double GetDistance(DOUBLE bx,DOUBLE by,DOUBLE x,DOUBLE y);
BOOL RectCross(DOUBLE x1, DOUBLE y1, DOUBLE x2, DOUBLE y2,const SHAPEPOS shp);
DOUBLE PointAtLine(DOUBLE x,DOUBLE y,DOUBLE x1,DOUBLE y1,DOUBLE x2,DOUBLE y2);
BOOL PointInCircle(DOUBLE x,DOUBLE y,DOUBLE x1,DOUBLE y1,DOUBLE radius);
BOOL PointInRgn(DOUBLE x,DOUBLE y,DPOINT*PointList,int nCount);
BOOL PointInRgn(DOUBLE x,DOUBLE y,const DOUBLERECT rc);
void ScalePoint(DOUBLE bx, DOUBLE by, DOUBLE xScal, DOUBLE yScal,DOUBLE &x,DOUBLE &y);
void RotatePoint(DOUBLE bx,DOUBLE by,double ang,DOUBLE &x,DOUBLE&y);